package com.cwt_taxi_xa.util;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

public class PhoneApp {
	/**
	 * 监听模式标记
	 * true：监听模式
	 * false：普通模式
	 */
	public static boolean monitorType = false;

	/**
	 * 是否监听成功
	 * true：是
	 * false：否
	 */
	public static boolean monitorSuccess = false;

	public static void call(Context context, String phoneNumber){
		Intent intent = new Intent(
				Intent.ACTION_CALL,
				Uri.parse("tel: "+phoneNumber));
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(intent);
		PhoneApp.monitorType = false;
	}

	public static void callInMonitorType(Context context, String phoneNumber){
		Intent intent = new Intent(
				Intent.ACTION_CALL,
				Uri.parse("tel: "+phoneNumber));
		intent.putExtra("MONITOR_TYPE", true);
		intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(intent);
		monitorType = true;
		//SendDateToSerial.witeSerialInfo(TelephonyBiz.getPhoneMonitorTypeByte(1));
	}

}
